package com.study.statictest;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
    private static  volatile SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public static  String formatFromDate(Date date)throws ParseException {
        return sdf.format(date);
    }
    public static Date parseToDate(String strDate) throws ParseException{

        return sdf.parse(strDate);
    }
}
